home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / impdes / dessin.frm < prev    next >
Text File  |  1995-05-08  |  5KB  |  92 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "DEMONSTRATION"
  4.    ClientHeight    =   4425
  5.    ClientLeft      =   4140
  6.    ClientTop       =   1530
  7.    ClientWidth     =   7110
  8.    Height          =   4830
  9.    Left            =   4080
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4425
  12.    ScaleWidth      =   7110
  13.    Top             =   1185
  14.    Width           =   7230
  15.    Begin DirListBox Dir1 
  16.       Height          =   1830
  17.       Left            =   4710
  18.       TabIndex        =   3
  19.       Top             =   1500
  20.       Width           =   2055
  21.    End
  22.    Begin ComboBox Combo1 
  23.       Height          =   300
  24.       Left            =   4710
  25.       TabIndex        =   2
  26.       Text            =   "Combo1"
  27.       Top             =   810
  28.       Width           =   2055
  29.    End
  30.    Begin PictureBox Picture1 
  31.       Height          =   2835
  32.       Left            =   600
  33.       Picture         =   DESSIN.FRX:0000
  34.       ScaleHeight     =   2805
  35.       ScaleWidth      =   3465
  36.       TabIndex        =   1
  37.       Top             =   540
  38.       Width           =   3495
  39.    End
  40.    Begin CommandButton Command1 
  41.       Caption         =   "Impression"
  42.       Height          =   345
  43.       Left            =   5130
  44.       TabIndex        =   0
  45.       Top             =   3900
  46.       Width           =   1815
  47.    End
  48. End
  49. '                                                                                                                                                                                                   '
  50. '                                                                                                                                                                                                    '
  51. 'Programme de dΘmonstration de l'impression des fenΩtres sur une imprimante                                                                                                                           '
  52. '                                                                                                                                                                                                      '
  53. '                                                                                                                                                                                                       '
  54.     DefInt A-Z
  55.     Option Explicit
  56.  
  57. Sub Command1_Click ()
  58.     Dim R As Integer
  59. '                                                                                                                                                                                                                               '
  60. '                                                                                                                                                                                                                                '
  61. 'Routine permettant d'effectuer les impressions                                                                                                                                                                                   '
  62. '                                                                                                                                                                                                                                  '
  63. '                                                                                                                                                                                                                                   '
  64.     'Initialisation de l'imprimante                                                                                                         '
  65.     Printer.ScaleMode = 3
  66.     Screen.MousePointer = 11
  67.     Printer.Print ""
  68.     'Dessin de la fenΩtre entiΦre avec les contours                                                                                                                                                                                                     '
  69.     R = PrintWindow(Printer.hDC, 100, 100, Printer.ScaleWidth - 200, Printer.ScaleHeight - 200, Form1.hWnd)
  70.     If Not R Then
  71.         MsgBox "Unable to print the form"
  72.         Exit Sub
  73.     End If
  74.     'Dessin de la fenΩtre entiΦre sans les contours                                                                                                                                                                                                     '
  75.     R = PrintClient(Printer.hDC, 100, 2000, Form1.hWnd, 4)
  76.     If Not R Then
  77.         MsgBox "Unable to print the form"
  78.         Exit Sub
  79.     End If
  80.     'Dessin du dessin uniquement                                                                                                                                                                                                     '
  81.     R = PrintClient(Printer.hDC, 100, 1650, Picture1.hWnd, 2)
  82.     If Not R Then
  83.         MsgBox "Unable to print the form"
  84.         Exit Sub
  85.     End If
  86.     'Fin de l'impression                                                                                                                                                                                                                        '
  87.     Printer.EndDoc
  88.     Screen.MousePointer = 0
  89. End Sub
  90.  
  91.  
  92.